Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding pod disruption budget support for envoy proxies #3583

Merged
merged 18 commits into from
Jun 12, 2024

Conversation

alexwo
Copy link
Contributor

@alexwo alexwo commented Jun 10, 2024

What this PR does / why we need it:
Allows to ensure that envoyproxy maintains a certain level of availability and resilience during maintenance operations.

Fixes # #3546

@alexwo alexwo requested a review from a team as a code owner June 10, 2024 16:37
Signed-off-by: Alexander Volchok <[email protected]>
@@ -277,6 +277,8 @@ type EnvoyProxyKubernetesProvider struct {
//
// +optional
UseListenerPortAsContainerPort *bool `json:"useListenerPortAsContainerPort,omitempty"`
// PodDisruptionBudget allows to control the pod disruption budget of ab Envoy Proxy.
PodDisruptionBudget *KubernetesPodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be EnvoyPdb instead ?

EnvoyService: DefaultKubernetesService(),
EnvoyDeployment: DefaultKubernetesDeployment(DefaultEnvoyProxyImage),
EnvoyService: DefaultKubernetesService(),
PodDisruptionBudget: DefaultKubernetesPDB(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would enable it by default, but looks like we'd want this to be opt in like hpa

Copy link
Contributor Author

@alexwo alexwo Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I have just removed the default.

alexwo added 2 commits June 10, 2024 19:00
Signed-off-by: Alexander Volchok <[email protected]>
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 68.42105% with 24 lines in your changes missing coverage. Please review.

Project coverage is 68.17%. Comparing base (0abdda7) to head (56f2798).

Files Patch % Lines
...ternal/infrastructure/kubernetes/infra_resource.go 72.72% 10 Missing and 2 partials ⚠️
...frastructure/kubernetes/proxy/resource_provider.go 76.92% 3 Missing and 3 partials ⚠️
internal/infrastructure/kubernetes/infra.go 0.00% 2 Missing and 2 partials ⚠️
...tructure/kubernetes/ratelimit/resource_provider.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3583   +/-   ##
=======================================
  Coverage   68.16%   68.17%           
=======================================
  Files         168      168           
  Lines       20408    20484   +76     
=======================================
+ Hits        13912    13964   +52     
- Misses       5494     5511   +17     
- Partials     1002     1009    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

alexwo added 3 commits June 10, 2024 20:34
Signed-off-by: Alexander Volchok <[email protected]>
Signed-off-by: Alexander Volchok <[email protected]>
@alexwo
Copy link
Contributor Author

alexwo commented Jun 11, 2024

/retest

@alexwo
Copy link
Contributor Author

alexwo commented Jun 11, 2024

/retest

2 similar comments
@alexwo
Copy link
Contributor Author

alexwo commented Jun 11, 2024

/retest

@alexwo
Copy link
Contributor Author

alexwo commented Jun 11, 2024

/retest

Copy link
Contributor

@guydc guydc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments

@@ -277,6 +277,10 @@ type EnvoyProxyKubernetesProvider struct {
//
// +optional
UseListenerPortAsContainerPort *bool `json:"useListenerPortAsContainerPort,omitempty"`

// EnvoyPDB allows to control the pod disruption budget of ab Envoy Proxy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ab => an

@@ -0,0 +1,96 @@
# gateway-addons-helm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be generated as part of this PR?

Copy link
Contributor Author

@alexwo alexwo Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug that caused this to be generated, however, now its fixed. here->bae64e3

// such as node drains or updates. This setting ensures that your envoy proxy maintains a certain level of availability
// and resilience during maintenance operations.
// +optional
MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty" protobuf:"bytes,1,opt,name=minAvailable"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need IntOrString here? The original K8s schema uses this type, but in other places in the EG API we expose use an Int and the convert to IntOrString if required.

Also, do we need protobuf:"bytes,1,opt,name=minAvailable" here?

MatchLabels: labels,
},
},
Status: v1.PodDisruptionBudgetStatus{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the empty status needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

alexwo added 3 commits June 11, 2024 17:49
Signed-off-by: Alexander Volchok <[email protected]>
Signed-off-by: Alexander Volchok <[email protected]>
Signed-off-by: Alexander Volchok <[email protected]>
@alexwo
Copy link
Contributor Author

alexwo commented Jun 11, 2024

some minor comments

Thanks Guy, updated.

Signed-off-by: Alexander Volchok <[email protected]>
guydc
guydc previously approved these changes Jun 11, 2024
Copy link
Contributor

@guydc guydc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@arkodg
Copy link
Contributor

arkodg commented Jun 11, 2024

hey @alexwo DCO is failing, can you squash, sign and repush ?

Signed-off-by: Alexander Volchok <[email protected]>
@alexwo
Copy link
Contributor Author

alexwo commented Jun 12, 2024

/retest

Signed-off-by: Alexander Volchok <[email protected]>
@alexwo
Copy link
Contributor Author

alexwo commented Jun 12, 2024

/retest

Copy link
Contributor

@shawnh2 shawnh2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just one nit

@@ -13,6 +13,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
autoscalingv2 "k8s.io/api/autoscaling/v2"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/policy/v1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better go with policyv1 here. same for all other places.

Signed-off-by: Alexander Volchok <[email protected]>
@guydc guydc merged commit 7fdc738 into envoyproxy:main Jun 12, 2024
26 checks passed
@alexwo alexwo deleted the pdb branch June 13, 2024 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants